package com.ling.sbbyyds.mapper.video;

import com.ling.sbbyyds.entity.video.VideoLike;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

/**
 * 评论点赞表(SbbCommentLike)表数据库访问层
 *
 * @author ling
 * @since 2022-08-13 17:47:56
 */
@Repository
public interface SbbVideoLikeMapper extends Mapper<VideoLike> {

    /**
     * 获取用户是否点视频
     *
     * @param videoId 视频id
     * @param userId  用户id
     * @return
     */
    @Select("SELECT COUNT(*) FROM sbb_video_like WHERE user_id = #{userId} AND video_id = #{videoId} ")
    Integer isLikeVideo(Long videoId, Long userId);


}

